/* Copyright 2010 John L. Reilly

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

     http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License. */

package com.riq.entity;

import java.io.Serializable;

import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.IdentityType;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

@PersistenceCapable(identityType = IdentityType.APPLICATION)
public class Member implements HasPrimaryKey<String>, Serializable {
	
	private static final long serialVersionUID = 1L;
	
	@Override
	public String getPrimaryKey() {
		// TODO Auto-generated method stub
		return null;
	}
	
	@PrimaryKey
	@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
	private Long id;
	
	@Persistent
	private Long deptId;

	@Persistent
	private String firstName;
	
	@Persistent
	private String lastName;
	
	@Persistent
	private String type; 
	
	@Persistent
	private String smsAddress; 
	
	@Persistent
	private String callerId1;
	
	@Persistent
	private String callerId2;
	
	@Persistent
	private String callerId3;
	
	@Persistent
	private String gpsAccuracy;
	
	@Persistent
	private double distance;
	
	@Persistent
	private String distGroup;
	
	@Persistent
	private long distTimeStamp;
	
	@Persistent
	private String cookieHash;
	
	@Persistent
	private String latitudeId;
	
	@Persistent
	private String trackingFlag;
	
	@Persistent
	private String lastLat;
	
	@Persistent
	private String lastLng;

	@Persistent
	private Long timeStamp;
	
    @Persistent
    private Long targetObjectId;
  
    @Persistent
    private String targetObjectType;

	public  Member(Long deptId, String firstName, String lastName, String type, String smsAddress,
			String callerId1, String callerId2, String callerId3, 
			String gpsAccuracy, double distance, String distGroup, long distTimeStamp, 
			String cookieHash, String latitudeId, String trackingFlag, String lastLat, String lastLng,
			Long timeStamp, Long targetObjectId, String targetObjectType) {
		
	 this.deptId = deptId;
	 this.firstName = firstName;
	 this.lastName = lastName;
	 this.type = type;	
	 this.smsAddress = smsAddress;
	 this.callerId1 = callerId1;
	 this.callerId2 = callerId2;
	 this.callerId3 = callerId3;
	 this.gpsAccuracy = gpsAccuracy;
	 this.distance = distance;
	 this.distGroup = distGroup;
	 this.distTimeStamp = distTimeStamp;
	 this.cookieHash = cookieHash;
	 this.latitudeId = latitudeId;
	 this.trackingFlag = trackingFlag;
	 this.lastLat = lastLat;
     this.lastLng = lastLng;
	 this.timeStamp = timeStamp;
	 this.targetObjectId = targetObjectId;
	 this.targetObjectType = targetObjectType;
	}
	
	
// VERBS
	
  public boolean ownedByDept(final Department d) {
    return this.getid() == deptId;
  }


// GETS	

	public Long getid() {
		return id;
	}
	
	public Long getdeptId() {
		return deptId;
	}

	public String getfirstName() {
		return firstName;
	}

	public String getlastName() {
		return lastName;
	}
	
	public String gettype() {
		return type;
	}
	
	public String getsmsAddress() {
		return smsAddress;
	}
	
	public String getcallerId1() {
		return callerId1;
	}
	
	public String getcallerId2() {
		return callerId2;
	}
	
	public String getcallerId3() {
		return callerId3;
	}
	
	public String getgpsAccuracy() {
		return gpsAccuracy;
	}
	
	public double getdistance() {
		return distance;
	}
	
	public String getdistGroup() {
		return distGroup;
	}

	public long getdistTimeStamp() {
		return distTimeStamp;
	}
	
	public String getcookieHash() {
		return cookieHash;
	}
	
	public String getlatitudeId() {
		return latitudeId;
	}
	
	public String gettrackingFlag() {
		return trackingFlag;
	}

	public String getlastLat() {
		return lastLat;
	}
	
	public String getlastLng() {
    return lastLng;
    }
  
	public Long gettimeStamp() {
		return timeStamp;
	}

    public Long gettargetObjectId() {
      return targetObjectId;
    }
 
    public String gettargetObjectType() {
      return targetObjectType;
    }
	
// SETS	
	
	
	public void setdeptId(Long deptId) {
		this.deptId = deptId;
	}
	
	public void setfirstName(String firstName) {
		this.firstName = firstName;
	}
	
	public void setlastName(String lastName) {
		this.lastName = lastName;
	}
	
	public void settype(String type) {
		this.type = type;
	}
	
	public void setsmsAddress(String smsAddress) {
		this.smsAddress = smsAddress;
	}
	
	public void setcallerId1(String callerId1) {
		this.callerId1 = callerId1;
	}
	
	public void setcallerId2(String callerId2) {
		this.callerId2 = callerId2;
	}
	
	public void setcallerId3(String callerId3) {
		this.callerId3 = callerId3;
	}
	
	public void setgpsAccuracy(String gpsAccuracy) {
		this.gpsAccuracy = gpsAccuracy;
	}
	
	public void setdistance(double distance) {
		this.distance = distance;
	}
	
	public void setdistGroup(String distGroup) {
		this.distGroup = distGroup;
	}
	
	public void setdistTimeStamp(long distTimeStamp) {
		this.distTimeStamp = distTimeStamp;
	}
	
	public void setcookieHash(String cookieHash) {
		this.cookieHash = cookieHash;
	}
	
	public void setlatitudeId(String latitudeId) {
		this.latitudeId = latitudeId;
	}
	
	public void settrackingFlag(String trackingFlag) {
		this.trackingFlag = trackingFlag;
	}

	public void setlastLat(String lastLat) {
		this.lastLat = lastLat;
	}
	
	public void setlastLng(String lastLng) {
    this.lastLng = lastLng;
    }
	
	public void settimeStamp(Long timeStamp) {
		this.timeStamp = timeStamp;
	}

    public void settargetObjectId(Long targetObjectId) {
      this.targetObjectId = targetObjectId;
    }
  
    public void settargetObjectType(String targetObjectType) {
      this.targetObjectType = targetObjectType;
    }

}